import Vue from "vue";
import App from "@/App.vue";
import Store from "@/store";
import Router from "@/moduleS/router";
import "@/common-main";

// ----
Router.beforeEach((to, from, next) => {
    // 不需要token页面 或者 已经登录的情况
    if (to.meta.noAuth || Store.state.userInfo.userToken) {
        next();
    } else {
        // 未登录
        next({ path: "/login" });
    }
});

// ---
// 获取服务商状态
// Store.dispatch("serverUserStatus");

new Vue({
    router: Router,
    store: Store,
    render: h => h(App)
}).$mount("#app");
